package com.company.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.company.project.pojo.contradictionRecord.ContradictionRecord;
import com.company.project.mapper.ContradictionRecordMapper;
import com.company.project.pojo.contradictionRecord.ContradictionRecordDTO;
import com.company.project.service.IContradictionRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 矛盾推送记录 服务实现类
 * </p>
 *
 * @author 任建波
 * @since 2019-08-13
 */
@Service
public class ContradictionRecordServiceImpl extends ServiceImpl<ContradictionRecordMapper, ContradictionRecord> implements IContradictionRecordService {

    @Autowired
    private ContradictionRecordMapper contradictionRecordMapper;

    /**
     * 获取矛盾资料记录
     */
    @Override
    public List<ContradictionRecordDTO> getcontradictionRecordListByContradictionId(Integer contradictionId) {
        List contradictionRecordList = contradictionRecordMapper.getcontradictionRecordListByContradictionId(contradictionId);

        return contradictionRecordList;
    }

    /**
    *查询推送记录
     */
    @Override
    public IPage<ContradictionRecordDTO> getContradictionRecordList(Integer currentPage) {
        IPage<ContradictionRecordDTO> contradictionRecordDTOIPage = contradictionRecordMapper.getContradictionRecordList(new Page(currentPage, 10));
        return contradictionRecordDTOIPage;
    }

    /**
     * 查询pc未读推送记录数
     */
    @Override
    public Integer getPCNotReadContradictionRecordCount() {
        return contradictionRecordMapper.getPCNotReadContradictionRecordCount();
    }

}
